package com.heima.hello.controller;

import com.heima.hello.service.EmailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

@RestController
public class HelloController {
    @Autowired
    private EmailService emailService;

    @RequestMapping("/hello")
    public String hello() {
        return "Hello springboot";
    }

    @RequestMapping("/send")
    public String send() {
        String title = "email test" + new Date();
        String context = "-------内容描述----";
        String to = "40033213@qq,com";
        return emailService.send(title, context, to);
    }
}
